// cell class which represents cell on map
class Cell {
    // y
    i = 0;

    // x
    j = 0;

    // fuel
    fuel = 0;

    /**
     * f - distance from start cell
     * h - heuristic
     * g - priority (f + h)
     */
    f = 0;
    h = 0;
    g = 0;

    // array of the connections
    edges = new Array(8);

    // link to previous cell
    parent = null;

    // flags
    isWall = false;
    isPath = false;
    isOpen = false;
    isClosed = false;
    isStart = false;
    isEnd = false;
    isVisible = false;

    constructor(i, j, fuel, isWall) {
        this.i = i;
        this.j = j;
        this.fuel = fuel;
        this.isWall = isWall;
    }
}

// edge class which represents connection between cells
class Edge {
    // cost of movement through edge
    weight = 0;

    // link to cell which edge points to
    target = null;

    constructor(weight, target) {
        this.weight = weight;
        this.target = target;
    }
}